﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KraveEntities;
using KraveDAL;

public partial class adminViewEventDetail : System.Web.UI.Page
{
    public Reservation res;
    protected void Page_Load(object sender, EventArgs e)
    {
        bool flag = true;
        int id = Convert.ToInt32(Request.QueryString["id"]);
        ReservationDAL rd = new ReservationDAL();
        res = new Reservation();

        res = rd.Retrieve(id , ref flag);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        ReservationDAL rd = new ReservationDAL();
        int id = Convert.ToInt32(Request.QueryString["id"]);

        bool rValue = rd.CancelEvent(id);
        if (rValue == true)
        {
            Response.Redirect("cancelEventSuccessfully.aspx");
        }
        else
        {
            Response.Redirect("errorpage.aspx");
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(this.GetType(), "PrintOperation", "printing()", true);
    }
}